package my.jwds.lcs01;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Date;

/**
 * LCS 01. 下载插件<br/>
 * <a href="https://leetcode-cn.com/problems/Ju9Xwi/">下载插件</a>
 */
public class LeastMinutes {


    public static void main(String[] args) {


        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYY-w e");
        LocalDate date =  LocalDate.parse("2021-31 2", formatter);
        System.out.println(date.getDayOfWeek().getValue());

        System.out.println(LocalDate.now().getDayOfYear());
        System.out.println(new LeastMinutes().leastMinutes(7));
    }

    public int leastMinutes(int n) {
        if (n == 1)return 1;
        return (int)Math.ceil(Math.log(n) / Math.log(2)) + 1;
    }

}
